﻿using System;
using System.Collections.Generic;
using System.Reflection;

namespace MyTestRunner.Domain
{
    /// <summary>
    /// Represents a class that is capable of finding tests.
    /// </summary>
    public interface ITestFinder
    {
        /// <summary>
        /// Finds all the tests in the given assembly.
        /// </summary>
        IEnumerable<MethodInfo> FindTestMethods(Assembly assembly);

        /// <summary>
        /// Tries to get the method that should be executed before each test. 
        /// </summary>
        bool TryGetSetUpMethod(Type testType, out MethodInfo setUpMethod);

        /// <summary>
        /// Tries to get the method that should be executed after each test. 
        /// </summary>
        bool TryGetTearDownMethod(Type testType, out MethodInfo tearDownMethod);

        /// <summary>
        /// Tries to get the expected exception type.
        /// </summary>
        bool TryGetExpectedExceptionType(MethodInfo testMethod, out Type expectedExceptionType);
    }
}
